<?xml version="1.0" encoding="UTF-8" ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:ui="http://java.sun.com/jsf/facelets"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.prime.com.tr/ui">

    <ui:composition template="/template/DefaultTemplate.xhtml">

        <ui:define name="content">
            <h:panelGroup id="messagePanel" layout="block">
                <h:messages errorStyle="color: red" infoStyle="color: green" layout="table"/>
            </h:panelGroup>

            <h:form prependId="false">
                <p:panel toggleable="true" id="customerView" header="View Customer Details">
                    <h:panelGrid columns="2">
                        <h:outputText value="ID: "/>
                        <h:outputText value="#{customerEntityController.selected.id}" title="#{bundle.ViewCustomerEntityTitle_id}"/>

                        <h:outputText value="Title: "/>
                        <h:outputText value="#{customerEntityController.selected.title}" title="#{bundle.ViewCustomerEntityTitle_title}"/>

                        <h:outputText value="User Name: "/>
                        <h:outputText value="#{customerEntityController.selected.name}" title="#{bundle.ViewCustomerEntityTitle_name}"/>

                        <h:outputText value="First Name: "/>
                        <h:outputText value="#{customerEntityController.selected.firstName}" title="#{bundle.ViewCustomerEntityTitle_firstName}"/>

                        <h:outputText value="Last Name: "/>
                        <h:outputText value="#{customerEntityController.selected.lastName}" title="#{bundle.ViewCustomerEntityTitle_lastName}"/>

                        <h:outputText value="Company Name: "/>
                        <h:outputText value="#{customerEntityController.selected.companyName}" title="#{bundle.ViewCustomerEntityTitle_companyName}"/>

                        <h:outputText value="Job Title: "/>
                        <h:outputText value="#{customerEntityController.selected.jobTitle}" title="#{bundle.ViewCustomerEntityTitle_jobTitle}"/>

                        <h:outputText value="Customer Account: "/>
                        <h:outputText value="#{customerEntityController.selected.customerAccount}" title="#{bundle.ViewCustomerEntityTitle_customerAccount}"/>

                        <h:outputText value="Customer Executive: "/>
                        <h:outputText value="#{customerEntityController.selected.customerExecutive}" title="#{bundle.ViewCustomerEntityTitle_customerExecutive}"/>

                        <h:outputText value="Customer Type: "/>
                        <h:outputText value="#{customerEntityController.selected.customerType}" title="Customer Type"/>


                        <h:outputText value="Created At: "/>
                        <h:outputText value="#{customerEntityController.selected.createdAt}" title="#{bundle.ViewCustomerEntityTitle_createdAt}">
                            <f:convertDateTime pattern="MM/dd/yyyy" />
                        </h:outputText>

                        <h:outputText value="Created By: "/>
                        <h:outputText value="#{customerEntityController.selected.createdBy}" title="#{bundle.ViewCustomerEntityTitle_createdBy}"/>

                        <h:outputText value="Last Modified At: "/>
                        <h:outputText value="#{customerEntityController.selected.lastModifiedAt}" title="#{bundle.ViewCustomerEntityTitle_lastModifiedAt}">
                            <f:convertDateTime pattern="MM/dd/yyyy" />
                        </h:outputText>

                        <h:outputText value="Last Modified By: "/>
                        <h:outputText value="#{customerEntityController.selected.lastModifiedBy.firstName}" title="#{bundle.ViewCustomerEntityTitle_lastModifiedBy}"/>
                    </h:panelGrid>    
                </p:panel>
                <br/>
                <p:panel toggleable="true" id="salesLeadContact" header="Contact Details">
                    <h:panelGrid columns="2">
                        <h:outputText value="#{bundle.ViewCustomerEntityLabel_contactNumber}"/>
                        <h:outputText value="#{customerEntityController.selected.contact.contactNumber}" title="#{bundle.ViewCustomerEntityTitle_contact}"/>

                        <h:outputText value="#{bundle.ViewCustomerEntityLabel_email}"/>
                        <h:outputText value="#{customerEntityController.selected.contact.email}" title="#{bundle.ViewCustomerEntityTitle_contact}"/>

                    </h:panelGrid>
                    <br />


                </p:panel>
                <br />
                <ui:include src="/entities/addressEntity/ListAddress.xhtml"/>
                <br />
                <p:commandButton ajax="false" action="Edit" value="#{bundle.ViewCustomerEntityEditLink}"/>
                <p:commandButton ajax="true" action="#{customerEntityController.destroyAndView}" value="Delete"/>
            </h:form>
        </ui:define>
    </ui:composition>

</html>
